<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			#guanggao{
					position: relative;
					width: 120px;
					height: 200px;	
					top:0;
					left: 0;
						}
			.close{position: absolute;
					top: 0;
					right: 0;
			
			}
			.body{position: absolute;
				top: 0;
				left: 130px;	
			
			}
		</style>
	</head>
	<body>
		<div id="guanggao">
			<img src="img/advpic.jpg" />
			<img src="img/close.jpg" class="close" onclick="disappear();"/>
		</div>
		<div class="body">
		<img src="img/contentpic.jpg" />	
	</div>
	<script type="text/javascript">
		var atop;
		var aleft;
		var aobj;
		function inix(){
			aobj=document.getElementById("guanggao");
			aleft=parseInt(document.defaultView.getComputedStyle(aobj,null).left);
		    atop=parseInt(document.defaultView.getComputedStyle(aobj,null).top);
			
		}
		function move(){
			var stop=parseInt(document.documentElement.scrollTop||document.body.scrollTop);
			var sleft=parseInt(document.documentElement.scrollLeft||document.body.scrollLeft);
			aobj.style.top=stop+atop+"px";
			aobj.style.left=sleft+aleft+"px";
		}
		function disappear(){
			aobj.style.display="none";
		}
		window.onload=inix;
		window.onscroll=move;
		
		
		
	</script>
	</body>
</html>
